package www.openteam.com.rewrite;

import android.content.Context;

import com.throrinstudio.android.common.libs.validator.AbstractValidate;
import com.throrinstudio.android.common.libs.validator.AbstractValidator;
import com.throrinstudio.android.common.libs.validator.ValidatorException;

/**
 * Created by OT on 2017-10-19.
 */

public class MNotEmptyValidator extends AbstractValidator {
    private int mErrorMessage;

    public MNotEmptyValidator(Context c, int mErrorMessage) {
        super(c);
        this.mErrorMessage = mErrorMessage;
    }

    @Override
    public boolean isValid(String value) {
        return value != null?value.length() > 0:false;
    }

    @Override
    public String getMessage() {
        return this.mContext.getString(this.mErrorMessage);
    }
}
